<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDictionaryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('dictionary', function (Blueprint $table) {
            $table->increments('id')->comment('自增ID');
            $table->string('name', 50)->default('')->comment('变量名称');
            $table->string('id_name', 100)->default('')->comment('变量标识，英文字母命名且不可重复，前台导航调用数据标识');
            $table->tinyInteger('type')->default(1)->comment('【备用】变量类型：1字符串 2数字');
            $table->string('description', 200)->default('')->comment('描述');
            $table->tinyInteger('status')->default(1)->comment('发布状态，0未发布，1已发布 ');
            $table->unsignedInteger('created_user_id')->default('0')->comment('管理员ID');
            $table->timestamp('created_at')->nullable()->comment('创建时间');
            $table->timestamp('updated_at')->nullable()->comment('更新时间');
            $table->softDeletes()->comment('删除时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('dictionary');
    }
}
